package org.ResearchProject.mapper;


import org.ResearchProject.pojo.Student;
import org.ResearchProject.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;

/**
 * 2024-12-13-12:51
 */
@Mapper
public interface StudentMapper {
    @Insert("insert into student(username,password,email,phoneNum,address,avatar,gender,name,auth) " +
            "values(#{username},#{password},#{email},#{phoneNum},#{address},#{avatar},#{gender},#{name},#{auth})")
    void addStudent(User user);
    @Select("select * from student where username=#{username}")
    Student selectByUsername(String username);

    void updateStudent(User user);
    @Select("select * from student")
    ArrayList<Student> selectAll();

    ArrayList<Student> conditionSelect(Student student);
    @Select("select * from student where id=#{studentId}")
    Student selectByUseId(Integer studentId);
    @Select("select * from student where wx_openid=#{openid}")
    Student selectByOpenid(String openid);
}
